﻿using SIS.Infrastructures.Dependencies;
using SIS.Repositories.Common;
using System.Collections.Generic;

namespace SIS.Services.Common
{
    public class BaseServices<T> : IService where T : class, new()
    {
        private readonly IBaseRepository<T> _repository;
        public BaseServices(IBaseRepository<T> repository)
        {
            _repository = repository;
        }

        public int Delete(T entity)
        {
            return _repository.Delete(entity);
        }

        public IList<T> GetAll()
        {
            return _repository.GetAll();
        }

        public int Insert(T entity)
        {
            return _repository.Insert(entity);
        }

        public int Update(T entity)
        {
            return _repository.Update(entity);
        }
    }
}
